import axios from '@/libs/api.request'
import urlSource from './urlSource'

export const login = ({userName, password}) => {
  const data = {
    userName,
    password
  }

  return axios.request({
    url: urlSource.apiUrl + 'authorize/login',
    data,
    method: 'post'
  })
}

export const getUserInfo = (token) => {
  return axios.request({
    url: 'get_info',
    params: {
      token
    },
    method: 'get'
  })
}

export const logout = (token) => {
  return axios.request({
    url: urlSource.apiUrl + 'authorize/loginOut',
    method: 'post'
  })
}
